// https://www.luogu.com.cn/problem/B2128

#include <vector>
#include <cstdio>
using namespace std;

int main() {
    int n;
    scanf("%d", &n);
    vector<int> isPrime(n+1, true);
    vector<int> primes;
    for (int i=2; i<=n; i++) {
        if (isPrime[i]) {
            primes.push_back(i);
        }
        for (const auto p: primes) {
            if (p > n / i) {
                break;
            }
            isPrime[i*p] = false;
            if (i % p == 0) {
                break;
            }
        }
    }
    printf("%d", static_cast<int>(primes.size()));
    return 0;
}